<template>
    <div id="app">
        <keep-alive>
            <router-view v-if="$route.meta.keepAlive" />
        </keep-alive>
        <router-view v-if="!$route.meta.keepAlive" />
    </div>
</template>

<script>
export default {
    name:"app",
    computed: {
		cachedViews() {
			// 动态计算需要缓存的页面列表
			return this.$router.getRoutes().filter(route => route.meta && route.meta.keepAlive)
		},
	},
};
</script>

<style>
html,
body,
#app {
	padding: 0px;
	margin: 0px;
	height: 100%;
}

#app {
	font-family: Avenir, Helvetica, Arial, sans-serif;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-align: left;
	color: #2c3e50;
	margin-top: 0px;
	height: 100%;
}
</style>